using System;
using System.Collections.Generic;
using System.Text;

namespace Pegasus.UnitTests.Runtime.Remoting
{
    /// <summary>
    /// The object use to remote 
    /// </summary>
    public class RemoteObject : MarshalByRefObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteObject"/> class.
        /// </summary>
        public RemoteObject()
        {
            object a = 0;
        }

        /// <summary>
        /// Adds one to the value passed in.
        /// </summary>
        /// <param name="x">The x.</param>
        /// <returns></returns>
        public int AddOne( int x )
        {
            return x + 1;
        }

        /// <summary>
        /// Appends one strings to the other.
        /// </summary>
        /// <param name="str1">The STR1.</param>
        /// <param name="str2">The STR2.</param>
        /// <returns></returns>
        public string AppendStrings( string str1, string str2 )
        {
            return str1 + str2;
        }

        /// <summary>
        /// Adds one day to the current date time.
        /// </summary>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        public DateTime AddOneDay( DateTime date )
        {
            return date.AddDays( 1.0 );
        }

        /// <summary>
        /// Gets the new GUID.
        /// </summary>
        /// <returns></returns>
        public Guid GetNewGuid()
        {
            return Guid.NewGuid();
        }

        /// <summary>
        /// Gets the type of the custom value.
        /// </summary>
        /// <param name="number">The number.</param>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public RemoteCustomValueType GetCustomValueType( int number, string name )
        {
            RemoteCustomValueType ret = new RemoteCustomValueType();
            ret.Number = number;
            ret.Name = name;

            return ret;
        }

        /// <summary>
        /// Gets the ref object.
        /// </summary>
        /// <returns></returns>
        public RemoteCustomRefType GetCustomRefType()
        {
            return new RemoteCustomRefType();
        }
    }
}
